//
//  NSNumber+Reform.m
//  YiJuZhangShou2.0
//
//  Created by 冷悦 on 16/4/12.
//  Copyright © 2016年 Mr.X. All rights reserved.
//

#import "NSNumber+Reform.h"

@implementation NSNumber (Reform)

+ (NSNumber *)isMarrayWithString:(NSString *)isMarray{
    if ([isMarray isEqualToString:@"未婚"]) {
        return [NSNumber numberWithUnsignedInteger:0];
    } else if ([isMarray isEqualToString:@"已婚"]) {
        return [NSNumber numberWithUnsignedInteger:1];
    } else {
        return [NSNumber numberWithUnsignedInteger:2];
    }
}

+ (NSNumber *)carStateWithString:(NSString *)carState{
    
    if ([carState isEqualToString:@"未购"]) {
        return [NSNumber numberWithUnsignedInteger:0];
    } else if ([carState isEqualToString:@"已购"]) {
        return [NSNumber numberWithUnsignedInteger:1];
    } else {
        return [NSNumber numberWithUnsignedInteger:2];
    }
}

+ (NSNumber *)decorateStateWithString:(NSString *)decorateState{
    
    if ([decorateState isEqualToString:@"未装修"]) {
        return [NSNumber numberWithInteger:0];
    }else if ([decorateState isEqualToString:@"简装修"]){
        return [NSNumber numberWithInteger:1];
    }else{
        return [NSNumber numberWithInteger:2];
    }
}

+ (NSNumber *)directionStateWithString:(NSString *)directionState{
    
    if ([directionState isEqualToString:@"东"]) {
        return [NSNumber numberWithInteger:1];
    }else if ([directionState isEqualToString:@"南"]){
        return [NSNumber numberWithInteger:2];
    }else if ([directionState isEqualToString:@"西"]){
        return [NSNumber numberWithInteger:3];
    }else if ([directionState isEqualToString:@"北"]){
        return [NSNumber numberWithInteger:4];
    }else if ([directionState isEqualToString:@"东南"]){
        return [NSNumber numberWithInteger:5];
    }else if ([directionState isEqualToString:@"西北"]){
        return [NSNumber numberWithInteger:6];
    }else if ([directionState isEqualToString:@"东北"]){
        return [NSNumber numberWithInteger:7];
    }else if ([directionState isEqualToString:@"西南"]){
        return [NSNumber numberWithInteger:8];
    }else{
        return [NSNumber numberWithInteger:9];
    }
}

+ (NSNumber *)carParkinglotStateWithString:(NSString *)carParkinglotState{

    if ([carParkinglotState isEqualToString:@"需要"]) {
        return [NSNumber numberWithInteger:1];
    }else if ([carParkinglotState isEqualToString:@"不需要"]){
        return [NSNumber numberWithInteger:2];
    }else{
        return [NSNumber numberWithInteger:0];
    }
}

@end
